<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">

<TITLE>Common command line syntax</TITLE>
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>

<BODY>

<P class="title"><A NAME="HELPCommandLineSyntax"></A>Command line syntax<hr></P>

<P>It is possible to perform WinRAR commands from the command line.
Common command line syntax is described below:</P>

<P><B>WinRAR  &lt;command&gt; -&lt;switch1&gt; -&lt;switchN&gt; &lt;archive&gt;
&lt;files...&gt; &lt;@listfiles...&gt; &lt;path_to_extract\&gt;</B>
</P><br>

<TABLE border="1" cellspacing="0">

<TR>
<TD><I>Command</I></TD>
<TD>Character combination specifying a function to be performed by WinRAR.
See the list of WinRAR commands <a href="HELPCommands.htm">here</a>.</TD>
</TR>

<TR>
<TD><I>Switch</I></TD>
<TD>Switches are used to define a specific type of operation,
compression strength, type of archive, etc.
See the list of WinRAR switches <a href="HELPSwitches.htm">here</a>.
</TD>
</TR>

<TR>
<TD><I>Archive</I></TD>
<TD>The name of the archive to process.</TD>
</TR>

<TR>
<TD><I>Files</I></TD>
<TD>The name(s) of files to be processed.</TD>
</TR>

<TR>
<TD><I>Listfiles</I></TD>
<TD>Listfiles are plain text files that contain names of
files to process. File names should start at the first column. It is
possible to put comments to the listfile after // characters. For example,
you may create backup.lst containing the following strings:
<P>c:\work\doc\*.txt//backup text documents</P>

<P>c:\work\image\*.bmp//backup pictures</P>

<P>c:\work\misc</P>

<P>and then run:</P>

<P>winrar a backup @backup.lst</P>

<P>You may specify both usual file names and list files in the same
command line.</P>
</TD>
</TR>

<TR>
<TD><I>Path_to_extract</I></TD>
<TD>Used only with commands <A HREF="HELPCmdE.htm"><B>e</B>
</A> and <A HREF="HELPCmdX.htm"><B>x</B></A>, indicating the folder
to place extracted files. If this folder does not exist, it
will be created. Alternatively it can be set with
<a href="HELPSwOP.htm"><b>-op&lt;path&gt;</b></a> switch.</TD>
</TR>
</TABLE><BR>


<h1><B>Notes</B></h1>

<P>a) If neither <I>files </I>nor <I>listfiles</I> are specified,
then <B>*.* </B>is implied and WinRAR will process all files;</P>

<P>b) If archive extension is not specified when creating an archive,
WinRAR will use the default archive format selected in the default
<A HREF="HELPProfiles.htm">compression profile</A>, but you may override
it by specifying either .rar or .zip extension.</P>

<P>If no archive extension is specified when extracting, WinRAR assumes .rar,
so * means all archives with .rar extension. If you need to process all
archives without extension, use *. mask. *.* mask selects all files.
You can use wildcards in archive name in most operations, such as extraction,
test and many others, but wildcards are not allowed when archiving
and deleting.</P>

<P>c) Switches entered on the command line override the same configuration
settings;</P>

<P>d) For commands <B>c, e, s, t, rr, k</B> and <B>x</B> wildcards
may be used in the archive name. Thus it is possible to process more
than one archive with a single command. Moreover, if you specify <A
HREF="HELPSwR.htm"><B>-r</B></A> switch with these commands, they will
search for archives in subfolders;</P>

<P>e) Some commands and switches are applicable only to RAR archives,
some both to <A HREF="HELPRARVersusZIP.htm">RAR and ZIP</A> and some
to all archive formats. This is dependent upon the functionality provided
by the archive format;</P>

<P>f) Commands and switches are not case sensitive, you may write
them both in upper and in lower case;</P>

<P>g) If any component of command line contains spaces, enclose it
to quotes.</P>

<h1><B>Examples</B></h1>

<ol>
  <li> add the folder "c:\latest data" to archive Info.rar
  </li>
</ol>
<blockquote>
  <p class="sample">WinRAR a Info.rar "c:\latest data"</p>
</blockquote>
<ol start="2">
  <li> unpack the archive Info.rar to folder d:\data</li>
</ol>
<blockquote>
  <p class="sample">WinRAR x Info.rar d:\data\</p>
</blockquote>

</BODY>
</HTML>
